<template>
  <div class="lock-pc">
    <el-dialog
        title="Lock Pc"
        :visible.sync="lockPcVisible"
        width="30%"
        :modal="false"
        :close-on-click-modal="false"
        :before-close="handleClose">
        <el-input v-model="password" placeholder="lockPc pin"></el-input>
        <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose">Cancel</el-button>
          <el-button type="primary" @click="handleConfirm">OK</el-button>
        </span>
    </el-dialog>

  </div>
</template>

<script>
import f from "@/utils/communication";

export default {
  name: "lockPc",
  props:{
    lockPcVisible:{
      type:Boolean
    }
  },
  data(){
    return{
      password:''
    }
  },

  methods:{
    handleClose(){
      this.$emit('handleClose')
    },

    handleConfirm(){
      if(this.password === ''){
        this.$message.warning('Lock pin can not be empty!')
        return false
      }
      this.$emit('handleClose')
      f.handleOut('lockpc',this.password)
    }
  }
}
</script>

<style scoped>

</style>